<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">门店:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="row[shop_id]" class="form-control selectpicker" required data-live-search="true" id="parent-select">
                <option value="">请选择</option>
                <?php if (!empty($shop) && is_array($shop)): ?>
                <?php foreach ($shop as $item): ?>
                <option value="<?= htmlspecialchars($item['id']) ?>"
                <?= $item['id'] == $row['shop_id'] ? 'selected' : '' ?>>
                <?= $item['name'] ?>
                </option>
                <?php endforeach; ?>
                <?php else: ?>
                <option value="">没有可选项</option>
                <?php endif; ?>
            </select>
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image_url')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image_url" class="form-control" size="50" name="row[image_url]" type="text" value="{$row.image_url|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image_url" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image_url"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image_url"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image_url"></ul>
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Player_count')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-player_count" class="form-control" name="row[player_count]" type="number" value="{$row.player_count|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-type_id" data-rule="required" data-source="game_category/index" class="form-control selectpage" name="row[type_id]" type="text" value="{$row.type_id|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">桌游目录:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="row[categoty_id]" class="form-control selectpicker" required data-live-search="true" id="parent-select">
                <?php if (!empty($type) && is_array($type)): ?>
                <?php foreach ($type as $item): ?>
                <option value="<?= htmlspecialchars($item['id']) ?>"
                <?= $item['id'] == $row['categoty_id'] ? 'selected' : '' ?>>
                <?= $item['type'] ?>
                </option>
                <?php endforeach; ?>
                <?php else: ?>
                <option value="">没有可选项</option>
                <?php endif; ?>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Rich_text')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-rich_text" class="form-control editor" rows="5" name="row[rich_text]" cols="50">{$row.rich_text|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">视频:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-video_url" class="form-control" size="50" name="row[video_url]" type="text" value="{$row.video_url|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span>
                        <button type="button" id="faupload-video" class="btn btn-danger faupload"
                                data-input-id="c-video_url"
                                data-mimetype="video/mp4,video/x-m4v,video/*"
                                data-multiple="true"
                                data-preview-id="p-video_url">
                            <i class="fa fa-upload"></i> {:__('Upload')}
                        </button>
                    </span>
                </div>
                <span class="msg-box n-right" for="c-video_url"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-video_url"></ul>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Carousel_Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-carousel_images" data-rule="required" class="form-control" size="50" name="row[carousel_images]" type="text" value="{$row.carousel_images|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                <span>
                    <button type="button" id="faupload-carousel_images" class="btn btn-danger faupload"
                            data-input-id="c-carousel_images"
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                            data-multiple="true"
                            data-preview-id="p-carousel_images">
                        <i class="fa fa-upload"></i> {:__('Upload')}
                    </button>
                </span>
                </div>
                <span class="msg-box n-right" for="c-carousel_images"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-carousel_images"></ul>
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
